From f9c14d0df8592d0071f19ee5c7f4be7c474ea788 Mon Sep 17 00:00:00 2001 From: robertl Date: Mon, 18 Jul 2005 20:16:37 +0000 Subject: [PATCH] Correct reads of gpx 'fix' value. --- gpsbabel/gpx.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/gpsbabel/gpx.c b/gpsbabel/gpx.c index f07198a45..36cdb8493 100644 --- a/gpsbabel/gpx.c +++ b/gpsbabel/gpx.c @@ -837,7 +837,17 @@ gpx_end(void *data, const char *el) wpt_tmp->sat = atof(cdatastrp); break; case tt_fix: - wpt_tmp->fix = atof(cdatastrp); + wpt_tmp->fix = atoi(cdatastrp)-1; + if ( wpt_tmp->fix < fix_2d) { + if (!strcasecmp(cdatastrp, "none")) + wpt_tmp->fix = fix_none; + else if (!strcasecmp(cdatastrp, "dgps")) + wpt_tmp->fix = fix_dgps; + else if (!strcasecmp(cdatastrp, "pps")) + wpt_tmp->fix = fix_pps; + else + wpt_tmp->fix = fix_unknown; + } break; case tt_unknown: end_something_else(); -- 2.30.2